package io.github.wanggit.antrpc.commons.rate;

import io.github.wanggit.antrpc.commons.bean.RegisterBeanMethod;
import io.vavr.CheckedFunction0;

import java.util.function.Consumer;
import java.util.function.Function;

public interface IResilience4jRateLimiter {
    Object run(
            RegisterBeanMethod registerBeanMethod,
            CheckedFunction0<Object> nextFunction,
            Consumer<? super Throwable> consumer,
            Function<? super Throwable, ?> onFailFunction);

    void checkOrChangeEventCountCircuitBreaker(RegisterBeanMethod registerBeanMethod);

    LimitInfo getLimitInfo(RegisterBeanMethod registerBeanMethod);
}
